
<script type="text/javascript" src="<?php echo backweb_JS_URL;?>jquery.js"></script>
<style>
*{outline:none;}
h3{font-size:1em;font-weight:normal;font-family:微软雅黑;padding:10px;border-bottom:1px solid #ff4401;}
.eva{margin:0 auto;}
.eva .content{margin:0 auto;border:1px solid #ccc;width:960px;margin-top:50px;margin-bottom:50px;}
.eva .content table{font-size:12px;	font-weight:normal;} 
.eva .content table th{border-bottom: 1px solid #ccc;padding:10px;}
.eva .content table tr{text-align:center;width:100%}
.eva .content table tr td{padding:10px;border-bottom:1px dashed #ccc;border-right:1px solid #ccc;font-size:1.3em;font-family:微软雅黑;}
.eva .content table tr td input[type='button']{width:80px;height:40px;background:#ff4401;border:2px solid #fff;cursor:pointer;border-radius:5px;font-size:1.2em;color:#fff;font-family:微软雅黑;  }
.eva .content table tr td input[type='reset']{width:80px;height:40px;background:#f3f8fe;border:2px solid #ccc;cursor:pointer;border-radius:5px;font-size:1.2em;color:#000;font-family:微软雅黑;  }
.eva .content table tr td textarea{border:1px solid #ccc;border-radius:5px;font-family:微软雅黑;padding:10px;}
#tb2{border:1px solid #ccc;margin:0 auto;margin-bottom:20px;text-align:left;background:#eee}
</style> 
<script>

$(function (){
	$("#sub").click(function (){
		var content = $(".content_details").val();
		$.ajax({
			url:'./index.php?r=eva/evaContent&goods_id=<?php echo $goods_id;?>&order_no=<?php echo $order_no;?>',
			data:{"type":"eva","content":content},
			type:"post",
			success:function(data){
				$(".content_details").val("");
				if(data == 999){
					alert('对不起，您已评论过该商品');
					window.location.href='./index.php?r=order/order&user_id=<?php echo Yii::app()->user->id;?>';
				}else{
				$("#tb").append(data);
				}
			},
			error:function (){
				alert('操作失败');
			},
		});
	});

})


</script>


 <div class="eva">
 	<div class="content">
		<h3>评价列表</h3>
		<div class="info">
			<form name="con">
			<table id="tb">
			<tr>
				<th style="width:100px;">用户</th>
				<th style="width:900px;">内容</th>
			</tr>
			<?php foreach($eva as $_v){?>
			<tr>
				<td><?php echo $_v['user_name'];?></td>
				<td><?php echo $_v['content'];?></td>
			</tr>
			
			<?php }?>
			</table>
			
			<table id="tb2">
			<tr>
				<td colspan="2">
					<textarea  class="content_details" name="eva_content" rows="15" cols="100"></textarea>
				</td>
			</tr>
			<tr>
				<td><input type="reset" value="重置" /></td>
				<td><input type="button" id="sub" value="发表" name="send" /></td>
			</tr>
			</table>
			</form>
		</div>
		
	</div>
 </div>
	